home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / comm1 / npns.lha / npns / src / NNet.h < prev    next >
C/C++ Source or Header  |  1996-05-06  |  1KB  |  73 lines

  1.  
  2. /*
  3.  *    NNet.h
  4.  *
  5.  *   Header file for Nicks network functions
  6.  *
  7.  */
  8.  
  9. #ifndef _NNET_H_
  10. #define _NNET_H_
  11.  
  12. /*
  13.  *   Includes
  14.  */
  15.  
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include <ctype.h>
  20.  
  21. #ifdef _AMIGA
  22. #include <bsdsocket.h>
  23. #endif
  24.  
  25. #include <sys/types.h>
  26. #include <sys/time.h>
  27. #include <sys/socket.h>
  28. #include <sys/errno.h>
  29. #include <netinet/in.h>
  30. #include <netdb.h>
  31.  
  32. /*
  33.  *   Definitions
  34.  */
  35.  
  36. #define TRUE            1
  37. #define FALSE            0
  38.  
  39. #define NOT_CONNECTED        -700
  40. #define CONNECTION_LOST        -701
  41. #define TIMEOUT            -702
  42. #define INTERRUPT        -703
  43.  
  44. #define TERM_LEN                5
  45. #define TERM_STR                "\r\n.\r\n"
  46.  
  47. #define CODE_LEN        3
  48.  
  49. #define DEF_TIMEOUT        60
  50.  
  51. /*
  52.  *   Protos
  53.  */
  54.  
  55.   extern int InitAmigaTCP( void );
  56.   extern void QuitAmigaTCP( void );
  57.  
  58.   extern int ChkTerm( char *, const char *, unsigned int );
  59.  
  60.   extern int SetAddress( const char *, const char *, struct sockaddr_in * );
  61.   extern long MakeConnection( const struct sockaddr_in * );
  62.   extern void EndConnection( long );
  63.   extern int SendCommand( const long, const char *, const char * );
  64.   extern int GetResponse( const long );
  65.   extern int GetData( const long, char *, int );
  66.  
  67.   extern long RecvN( const long, char *, long, long, unsigned int );
  68.   extern long TORecv( const long, char *, long, long, unsigned int );
  69.  
  70. #define close CloseSocket
  71.  
  72. #endif
  73.